package com.zimmur.app.mocolink.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zimmur.app.mocolink.dao.AppVersionMapper;
import com.zimmur.app.mocolink.domain.model.AppVersion;
import com.zimmur.app.mocolink.domain.model.AppVersionExample;
import com.zimmur.app.mocolink.service.IAppVersionService;
@Service
public class AppVersionServiceImpl implements IAppVersionService{
	@Autowired
	private AppVersionMapper appVersionMapper;
	@Override
	public AppVersion selectById(Integer versionId) {
		return appVersionMapper.selectByPrimaryKey(versionId);
	}

	@Override
	public AppVersion selectNew() {
		AppVersionExample example = new AppVersionExample();
		example.setOrderByClause(" id desc");
		List<AppVersion> list = appVersionMapper.selectByExample(example);
		if(list!=null && list.size()>0){
			return list.get(0);
		}
		return null;
	}

}
